package com.yuanyefu.jdbc;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 * Created by Administrator on 2017/9/18 0018.
 */
public class StudentTest {
    public static void main(String[] args){
        Student a = new Student();
        a.setId(12233);
        a.setAge(214);
        a.setName("hello hibernate!12");
        Session currentSession = HibernateUtil.currentSession();
        currentSession.beginTransaction();
        currentSession.save(a);
        currentSession.getTransaction().commit();
        currentSession.close();
    }
}
